package tcpFirmware;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

public class UploadPackage implements Serializable {
//    byte[] img;
    int imgLength;
    String filename;
    String detail;
    ArrayList<HashMap<String,String>> data=new ArrayList<>();

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }



//    public void setImg(String filepath){
//        try {
//            File f = new File(filepath);
//            FileInputStream inputStream = new FileInputStream(f);
//            BufferedInputStream bis = new BufferedInputStream(inputStream);
//            ByteArrayOutputStream byto = new ByteArrayOutputStream();
//            byte[] line = new byte[102400];
//            int chunksize;
//            while((chunksize=bis.read(line))!=-1){
//                byto.write(line,0,chunksize);
//            }
//            img = byto.toByteArray();
//            imgLength=img.length;
//            filename = f.getName();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }

    public void setData(ArrayList<HashMap<String,String>> d){
        data=d;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public ArrayList<HashMap<String, String>> getData() {
        return data;
    }

    public int getImgLength() {
        return imgLength;
    }

//    public byte[] getImg() {
//        return img;
//    }

    public String getDetail() {
        return detail;
    }
}
